<html>
<head>
	<title>模拟设备签到</title>
	{{>/WEB-INF/pages/common/head_refs.part.html}}
	<script type="text/javascript">
		$(document).ready(function() {
			//聚焦第一个输入框
			$("#checkin_deviceId").focus();
			//为inputForm注册validate函数
			$("#inputForm").validate();
			$("#addTag").bind("click", function(){
				var name=$('#tagsTable tr:last input')[0].name;
				var index=/\d+/.exec(name)[0];
				index=parseInt(index);
				index++;
				$("#tagsTable")
			  	.append('<tr>'+
			  			'<td><input type="text" name="tags['+index+'].key" class="span1"/>=</td>'+
						'<td><input type="text" name="tags['+index+'].value" class="span1"}"/></td>'+
			  		'</tr>');
			}); 
			 
			 $("#delTag").bind("click", function(){
			  	$('#tagsTable tr:last').remove();
			 }); 
		});
	</script>
</head>
<body>
<div class="container">
{{>/WEB-INF/pages/common/layout_header.part.html}}
	<ul class="breadcrumb">
	  <li><a href="{{ctx}}">首页</a> <span class="divider">/</span></li>
	  <li class="active">模拟设备签到</li>
	</ul>
	<form id="inputForm" action="{{ctx}}/push/dc/checkin" method="post" class="form-horizontal">
		<fieldset>
			<legend><small>模拟设备签到</small></legend>
			<div class="control-group">
				<label for="checkin_title" class="control-label">设备ID:</label>
				<div class="controls">
					<input type="text" id="checkin_deviceId" name="deviceId"  value="{{checkin.deviceId}}" class="input-large required" maxlength="30"/>
				</div>
			</div>	
			<div class="control-group">
				<label for="appId" class="control-label">应用ID:</label>
				<div class="controls">
					<input type="text" id="appId" name="appId" class="input-large required" value="{{checkin.appId}}"/>
				</div>
			</div>
			<div class="control-group">
				<label for="pushToken" class="control-label">签到Token:</label>
				<div class="controls">
					<input type="text" id="pushToken" name="pushToken" class="input-large required" value="{{checkin.pushToken}}" />
				</div>
			</div>
			<div class="control-group">
				<label for="channelId" class="control-label">渠道ID:</label>
				<div class="controls">
					<input type="text" id="channelId" name="channelId" class="input-large required" value="{{checkin.channelId}}"/>
				</div>
			</div>
			<div class="control-group">
				<label for="deviceName" class="control-label">设备名:</label>
				<div class="controls">
					<input type="text" id="deviceName" name="deviceName" class="input-large" value="{{checkin.deviceName}}"/>
				</div>
			</div>
			<div class="control-group">
				<label for="osName" class="control-label">操作系统:</label>
				<div class="controls">
					<input type="text" id="osName" name="osName" class="input-large" value="{{checkin.osName}}"/>
				</div>
			</div>
			<div class="control-group">
				<label for="osVersion" class="control-label">操作系统版本:</label>
				<div class="controls">
					<input type="text" id="osVersion" name="osVersion" class="input-large" value="{{checkin.osVersion}}"/>
				</div>
			</div>
			<div class="control-group">
				<label for="alias" class="control-label">别名:</label>
				<div class="controls">
					<input type="text" id="alias" name="alias" class="input-large" value="{{checkin.alias}}"/>
				</div>
			</div>
			<div class="control-group">
				<label for="tags" class="control-label">标签:</label>
				<div class="controls">
					<button id="addTag" class="btn">增加</button>
					<button id="delTag" class="btn">删除</button>
					<table id="tagsTable">
						<tr>
							<td><input type="text" id="tags" name="tags[0].key" class="span1" />=</td>
							<td><input type="text" id="tags" name="tags[0].value" class="span1" /></td>
						</tr>
					</table>
				</div>
			</div>
			<div class="form-actions">
				<input id="submit_btn" class="btn btn-primary" type="submit" value="提交"/>&nbsp;	
				<input id="cancel_btn" class="btn" type="button" value="返回" onclick="history.back()"/>
			</div>
		</fieldset>
	</form>
	{{>/WEB-INF/pages/common/layout_footer.part.html}}
</div>
</body>
</html>
